﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;
namespace BLL
{
   public class CounselingBLL
    {
       
        /// <summary>
        /// 健康咨询表分页显示
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
       public static dynamic Counselingshow(int pageindex, int pagesize)
       {
           var count = CounselingDAL.Counselingcount();
           var db = CounselingDAL.Counselingshow(pageindex,pagesize);
           dblist page = new dblist();
           page.pageindex = pageindex;
           page.pagesize = pagesize;
           page.pagecount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(count) / Convert.ToDouble(pagesize)));
           page.db = db;
           return page;
       }


       /// <summary>
     /// 获取健康资讯类型表
     /// </summary>
     /// <returns></returns>

       public static dynamic CounselingTypeshow()
       {
           return CounselingDAL.CounselingTypeshow();
       }

       /// <summary>
        ///热门咨询分页显示
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public static dynamic remenzixunshow(int pageindex, int pagesize)
        {
            var count = CounselingDAL.zixuncountcount();
            var db = CounselingDAL.remenzixunshow(pageindex,pagesize);
            dblist page = new dblist();
            page.pageindex = pageindex;
            page.pagesize = pagesize;
            page.pagecount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(count) / Convert.ToDouble(pagesize)));
            page.db = db;
            return page;
        }
     

    }
}
